
    kernel void TimeStep(global const float* mass, 
                         global const int* state,                         
                         global const float* force, 
                         global const float* oldpos,
                         global const float* oldvel,
                         global float* newpos,
                         global float* newvel,
                         float time, int numElements) {

        // get index into global data array
        int iGID = get_global_id(0);

        // bound check (equivalent to the limit on a 'for' loop for standard/serial C code
        if (iGID >= numElements)  {
            return;
        }


 		float acc = force[iGID] / mass[iGID];
 		float halftt = 0.5 * time * time; 		
 		newpos[iGID] = oldpos[iGID] + oldvel[iGID] / time + acc * halftt; 		
        newvel[iGID] = oldvel[iGID] + acc / time;   
    }
